package com.jeff.tianti.controller;

import com.jeff.tianti.cms.dto.font.LegalCaseFontQueryDTO;
import com.jeff.tianti.cms.entity.Organization;
import com.jeff.tianti.cms.service.OrganizationService;
import com.jeff.tianti.common.dto.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;

import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.CriteriaQuery;
import javax.persistence.criteria.Predicate;
import javax.persistence.criteria.Root;

@CrossOrigin(maxAge = 3600)
@RestController
@RequestMapping("/organization")
public class OrganizationController {
    @Autowired
    OrganizationService organizationService;

    @RequestMapping(value = "/list", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public AjaxResult legalCasesList() {
        return AjaxResult.setSuccessData(organizationService.queryOrganizationList(null));
    }
    @RequestMapping(value = "/detail", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public AjaxResult legalCasesdetail(String id) {
        return AjaxResult.setSuccessData(organizationService.find(id));
    }
}
